import request from '@/utils/request'

/**
 * 获取分类
 */
export const getCategory = () => {
  return request({
    url: '/v1/postclass'
  })
}

/**
 * 分类列表
 */
export const getCategoryList = (id, page) => {
  return request({
    url: `/v1/topicclass/${id}/topic/${page}`
  })
}

/**
 * 登录
 */
export const loginUser = data => {
  return request({
    url: '/v1/topicclass',
    data
  })
}

/**
 * 注册
 */
export const registerUser = data => {
  return request({
    url: '/v1/user/reg',
    method: 'POST',
    data
  })
}
